package com.wondertek.service.entity.sys;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.wondertek.common.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * @author xqs
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("sys_menu")
public class SysMenuPo extends BaseEntity {

    /**
     * 父级id
     */
    @Schema(name = "parentId",description = "父级id")
    private String parentId;

    /**
     * 菜单名
     */
    @Schema(name = "menuName",description = "菜单名")
    private String menuName;

    /**
     * 类型 MENU 菜单, BUTTON 按钮
     */
    @Schema(name = "useType",description = "目录menu 菜单route 详情details 外嵌页面iframe 按钮button")
    private String useType;

    /**
     * 类型 MENU 菜单, BUTTON 按钮
     */
    @Schema(name = "menuType",description = "类型 MENU 菜单, BUTTON 按钮")
    private String menuType;

    /**
     * 路由地址
     */
    @Schema(name = "menuUrl",description = "路由地址")
    private String menuUrl;

    /**
     * 组件地址
     */
    @Schema(name = "menuComponent",description = "组件地址")
    private String menuComponent;

    /**
     * 图标
     */
    @Schema(name = "menuIcon",description = "菜单图标")
    private String menuIcon;

    /**
     * 权限code
     */
    @Schema(name = "menuCode",description = "权限code")
    private String menuCode;

    /**
     * 公共权限
     */
    @Schema(name = "commonAuth",description = "公共权限 1是公共权限 默认为0")
    private Integer commonAuth;

    /**
     * 排序
     */
    @Schema(name = "sort",description = "排序")
    private Integer sort;


    /**
     * 启用 ENABLE 关闭 DISABLE
     */
    @Schema(name = "status",description = "启用 ENABLE 关闭 DISABLE")
    private String status;

    //************ 以下非数据库字段 ***************

    @TableField(exist = false)
    @Schema(name = "children",description = "子菜单")
    private List<SysMenuPo> children = new ArrayList<>();

    @TableField(exist = false)
    @Schema(name = "auths",description = "按钮权限")
    private List<String> auths = new ArrayList<>();

}
